package com.xiaozhu.pojo.vo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.ai.chat.messages.Message;
/**
 * @author 朱慧军
 * @version 1.0
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class MessageVo {

    private String role;
    private String content;

    public MessageVo(Message message){
        switch (message.getMessageType()){
            case USER:
                role = "user";
                break;
            case ASSISTANT:
                role = "assistant";
                break;
            default:
                role = "";
                break;

        }

        this.content = message.getText();
    }
}
